package com.power.sifa.approve.model;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.plf.core.common.annotations.FieldEnumText;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
*  干预行政复议活动记录实体类
*/

@Entity
@ApiModel(value="干预行政复议活动记录")
@Data
@Table(name="Apl_decision_record",schema="sfapprove")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Apl_decision_record.Apl_decision_recordPK.class) 用于复合组件
public class Apl_decision_record extends BaseModel implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "序号")
    private String id;

    @ApiModelProperty(value = "applyid")
    private String applyid;

    @ApiModelProperty(value = "faapplyid")
    private String faapplyid;

    @ApiModelProperty(value = "是否存在该情况")
    private Integer isexist;

    @ApiModelProperty(value = "干预人信息")
    private String personradio;

    @ApiModelProperty(value = "干预人其他情况")
    private String personother;

    @ApiModelProperty(value = "干预内容信息")
    private String contentradio;

    @ApiModelProperty(value = "干预内容其他情况")
    private String contentother;

    @ApiModelProperty(value = "具体情况")
    private String detail;

    @ApiModelProperty(value = "签名")
    private String sign;

    @ApiModelProperty(value = "签名时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date signdate;

    @ApiModelProperty(value = "主办人还是协办人")
    private Integer signtype;

    /**
     *  是否存在该情况文本
     */
    @Transient
    @FieldEnumText(eum="Tp_yesno", valuefield="isexist")
    private String isexist_text;

    /**
     *  干预人信息文本
     */
    @Transient
    @FieldEnumText(eum="Tp_intervene_person", valuefield="personradio")
    private String personradio_text;

    /**
     *  干预内容信息文本
     */
    @Transient
    @FieldEnumText(eum="Tp_intervene_content", valuefield="contentradio")
    private String contentradio_text;

    /**
     *  主办人还是协办人文本
     */
    @Transient
    @FieldEnumText(eum="Tp_yesno", valuefield="signtype")
    private String signtype_text;


    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("applyid", this.getApplyid());
        map.put("faapplyid", this.getFaapplyid());
        map.put("isexist_text", this.isexist_text);
        map.put("isexist", this.getIsexist());
        map.put("personradio_text", this.personradio_text);
        map.put("personradio", this.getPersonradio());
        map.put("personother", this.getPersonother());
        map.put("contentradio_text", this.contentradio_text);
        map.put("contentradio", this.getContentradio());
        map.put("contentother", this.getContentother());
        map.put("detail", this.getDetail());
        map.put("sign", this.getSign());
        map.put("signdate", this.getSigndate());
        map.put("signtype_text", this.signtype_text);
        map.put("signtype", this.getSigntype());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Apl_decision_recordPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Apl_decision_recordPK pk = (Apl_decision_recordPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}